package com.pool.socket;

import java.io.*;
import java.util.*;
import javax.jms.*;

public class MQListener implements MessageListener {

	@Override
	public void onMessage(Message message) {
		if (message instanceof MapMessage) {
			MapMessage mapmessage = (MapMessage) message;

			try {
				if (mapmessage.itemExists("TypeName")) {
					String prop = mapmessage.getStringProperty("TypeName");
					if (prop.equalsIgnoreCase("ConfigRequest")) {
						String uuid = mapmessage.getStringProperty("UUID");
						// get gateway uuid
					} else if (prop.equalsIgnoreCase("TimeSet")) {

					} else if (prop.equalsIgnoreCase("TimeRequest")) {

					} else {
						System.out.println(prop);
					}
				}
			} catch (JMSException ex) {
				System.out.println("JMSException happen!");
			}

		}
	}
}
